using KinonekoSoftware.Foundation.UI.Converters;
using KinonekoSoftware.Studio.Services.Editors;

namespace KinonekoSoftware.Studio.Resources.Converters
{
    public sealed class FindComposeComponentGeometryConverter: ConverterBase
    {
        public override object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            string icon;
            
            if (value is ComposeComponent cc)
            {
                icon = cc.Icon;
            }
            else
            {
                icon = ComposeComponent.Icon_Info;
            }

            return Geometry.Parse(icon);
        }
    }
}